//If most of an object changes while the object remains logically const, 
//it is often better to place the changing data in a separate object and access
//it indirectly
#include <iostream>
using namespace std;
struct B{
  int i;
};

class A {
  B* b;
public:
  void set_i(int ii) const;
  int get_i() const;
  A(){b = new B;}
};
void A::set_i(int ii) const //const can not be omitted, it specifies 'this'
{
  b->i = ii;
}

int A::get_i() const
{
  return b->i;
}

int main()
{
  A a;
  a.set_i(12);
  cout<<"a.i = "<<a.get_i()<<endl;

  const A const_a;//uninitialized const 'const_a' if no constructor
  const_a.set_i(1212);
  cout<<"const_a.i = "<<const_a.get_i()<<endl;
  return 0;
}
